package test;

public class Oop {
    public static void main(String args[]) {
        son d = new son();
        System.out.print(d.a + "," + d.b);
        father g = new father(1);
        g = d;
        d = (son) g;
        System.out.println(g.toString());
        int a[] = new int[2];
        son gg[] = new son[2];
        son haha = new son(1);
        System.out.println(haha.d+" "+haha.a);
        father gaga = new son();
        //son ggaga = (son)gaga;
        gaga.pc();
    }
}


class son extends father {
    int d;
    int a =10;
    int gg = 12;
    static{
        System.out.println("静态代码块加载");
    }
    {
        System.out.println("代码块加载");
    }
    public son() {
        super(1);
    }

    son(int c) {
        super(1);
        d = super.a;
    }

    son(int c, int d) {
        super(1);
    }

    void get() {
        System.out.println(super.a);
    }

    int get(int a) {
        return 0;
    }

    void ggg(){
        System.out.println("gaga");
    }
}

class father extends grandpa {
    father(int c, int d) {
        a = 10;
        b = 11;
        int gg = (int) 5.13;
    }

    father(int c) {
        System.out.println("niu");
        a = 33;
        b = 5;

    }
    void pc(){
        System.out.println("pc");
    }
}

class grandpa {
    int a=10;
    int b;

    grandpa() {
        a = 100;
        b = 101;
    }

    grandpa(int c) {
        a = 36;
        b = 5;
    }
}